package com.ljf.authority.dto.command;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.ljf.common.validation.AddGroup;
import com.ljf.common.validation.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * API列表定义--新增修改  authority_base_api_tabulation
 *
 * @author LJF
 * @since 2024-10-24
 */
@Data
@ApiModel("API列表定义--新增修改")
public class AuthorityBaseApiTabulationCommand implements Serializable {

    @JsonProperty("id")
    @ApiModelProperty(value = "ID")
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Long id;

    @JsonProperty("url")
    @ApiModelProperty(value = "URL地址")
    @NotEmpty(message = "URL地址不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String url;

    @JsonProperty("method")
    @ApiModelProperty(value = "请求方法")
    @NotNull(message = "请求方法不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer method;

    @JsonProperty("permissionType")
    @ApiModelProperty(value = "权限类型")
    @NotNull(message = "权限类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer permissionType;

    @JsonProperty("synchronizationType")
    @ApiModelProperty(value = "同步类型")
    @NotNull(message = "同步类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer synchronizationType;

}
